import * as mongoose from 'mongoose';

// Issue Schema
export const IssueSchema = new mongoose.Schema({
  // 问题ID
  id: mongoose.SchemaTypes.ObjectId,
  // 标题
  title: String,
  // 描述
  description: String,
  // 状态
  status: {
    type: String,
    enum: ['Open', 'Closed', 'In-Progress'],
  },
  // 优先级
  priority: {
    type: String,
    enum: ['Low', 'Medium', 'High'],
  },
  // 创建时间
  createdAt: {
    type: Date,
    default: Date.now,
  },
  // 更新时间
  updatedAt: {
    type: Date,
    default: Date.now,
  },
  // 报告者ID
  reporterId: Number,
  // 受分配者ID
  assigneeId: Number,
  // 项目ID
  projectId: mongoose.SchemaTypes.ObjectId,
  // 团队ID
  teamId: Number,
});